50 CLEAR,,34000!
90 SONG$=" t2880 O3 C4 O4 c P6 t720 O3 E6D6C6 O4 T2880 c o3 T720 g3 P3 O2 e6f6e6D p3"
92 ARIES$="d12f d12 p6 d12f d12 P1"
100 SCREEN 0: WIDTH 40: SCORE=0
110 COLOR 0,1: CLS
120 LOCATE 24,10: PRINT "  STAR WARS"
130 PRINT:PRINT" V1.0 Copyright @ 1982 by David T. Wang"
132 PRINT " All rights reserved. Permission granted";:PRINT" for non-profit use and copying.":PRINT
133 PLAY "MB  XSONG$;XARIES$;"
140 PRINT " In a galaxy far far away..."
145 FOR I=1 TO 500: NEXT I
150 PRINT " In a time long long ago ..."
155 FOR I=1 TO 500 : NEXT I
160 PRINT " There was a revolution against"
165 FOR I=1 TO 500 : NEXT I
170 PRINT "  an evil empire headed by Darth Vader."
175 FOR I=1 TO 500 : NEXT I
180 PRINT " YOU, young Luke Skywaker, are in a"
185 FOR I=1 TO 500 : NEXT I
190 PRINT "  space war to the death !!!!"
195 FOR I=1 TO 500 : NEXT I
200 PRINT" You are fighting the tie-fighters."
201 PLAY "MB  XSONG$;XARIES$;"
210 PRINT" Use the joystick to aim your laser gun.";
215 FOR I=1 TO 500 : NEXT I
220 PRINT" Push the red button to fire."
225 FOR I=1 TO 500 : NEXT I
230 PRINT" When the Tie-fighter flashes,"
235 FOR I=1 TO 500 : NEXT I
240 PRINT"  it is about to shoot you !"
245 FOR I=1 TO 500 : NEXT I
250 PRINT" Push the black button to activate"
255 FOR I=1 TO 500 : NEXT I
260 PRINT"  an energy shield to protect you."
265 FOR I=1 TO 500 : NEXT I
270 PRINT " GOOD LUCK! MAY THE FORCE BE WITH YOU!"
275 FOR I=1 TO 500 : NEXT I
280 PRINT " Hit any key to begin."
300 A$=INKEY$: IF A$ ="" THEN GOTO 300
345 PLAY "MB  XSONG$;XARIES$;"
1010 ON STRIG(0) GOSUB 1690
1020 STRIG(0) ON
1030 RANDOMIZE VAL(MID$(TIME$,7,2))
1040 DIM SHIP(88),GUN(10), FLASHIP(88)
1050 SCREEN 1: COLOR 1,0: CLS
1060 GUNX=10:GUNY=10
1070 CIRCLE(100,100),9,3,,,9/18
1080 LINE(90,90)-(88,100),3
1090 LINE(90,110)-(88,100),3
1100 LINE(110,90)-(112,100),3
1110 LINE(110,110)-(112,100),3
1120 PAINT(100,100),3
1130 CIRCLE(50,50),2,2:PAINT(50,50),2
1140 GET(88,90)-(112,110),SHIP
1150 GET(48,48)-(52,52),GUN
1160 CIRCLE(100,100),9,2,,,9/18
1170 LINE(90,90)-(88,100),2
1180 LINE(90,110)-(88,100),2
1190 LINE(110,90)-(112,100),2
1200 LINE(110,110)-(112,100),2
1210 PAINT(100,100),2
1220 GET (88,90)-(112,110),FLASHIP
1225 ROUND=62: SCORE=0
1227 RANGE=82-ROUND
1230 X=199:Y=100:CLS
1240 PUT(X,Y),SHIP,XOR
1250 PUT(GUNX,GUNY),GUN,XOR
1260 DELX=INT(RND*(RANGE)-RANGE/2):DELY=INT(RND*(RANGE)-RANGE/2):MAX=2+ROUND/2
1270 FOR I=1 TO MAX
1280 OLDX=X: OLDY=Y
1290 X=X+DELX: Y=Y+DELY
1300 IF X<0 THEN X=0:I=MAX
1310 IF X>295 THEN X=295: I=MAX
1320 IF Y<0 THEN Y=0: I=MAX
1330 IF Y>179 THEN Y=179: I=MAX
1340 STRIG(0) STOP
1350 OLDGUNX=GUNX:OLDGUNY=GUNY
1360 GUNX=STICK(0)*2.4:GUNY=STICK(1)*1.5
1370 PUT (OLDX,OLDY),SHIP,XOR
1380 PUT(X,Y),SHIP,XOR
1390 PUT(OLDGUNX,OLDGUNY),GUN,XOR
1400 PUT(GUNX,GUNY),GUN,XOR
1410 STRIG(0) ON
1420 NEXT I
1430 IF INT(RND*(3+ROUND/16))<>1 THEN GOTO 1520
1440 RAYX=INT(RND*320):RAYY=INT(RND*200):RAYDIR=INT(RND*7)
1450 FOR I=1 TO 2
1456 STRIG(0) STOP
1460 PUT(X,Y),FLASHIP,PSET
1470 FOR J=1 TO 50:NEXT J
1480 PUT(X,Y),SHIP,PSET
1485 STRIG(0) ON
1490 FOR J=1 TO 50:NEXT J
1500 NEXT I
1510 ON RAYDIR+1 GOSUB 1530,1650,1560,1650,1590,1620,1650
1520 GOTO 1260
1530 LINE(X,Y)-(RAYX,0),1
1540 FOR J=1 TO 20: SOUND 500+30*J,.5:NEXT J
1550 LINE(X,Y)-(RAYX,0),0: RETURN
1560 LINE(X,Y+20)-(RAYX,199),1
1570 FOR J=1 TO 20: SOUND 500+30*J,.5:NEXT J
1580 LINE(X,Y+20)-(RAYX,199),0:RETURN
1590 LINE(X+24,Y)-(319,RAYY),1
1600 FOR J=1 TO 20: SOUND 500+30*J,.5:NEXT J
1610 LINE(X+24,Y)-(319,RAYY),0:RETURN
1620 LINE(X,Y)-(0,RAYY),1
1630 FOR J=1 TO 20: SOUND 500+30*J,.5:NEXT J
1640 LINE(X,Y)-(0,RAYY),0  :RETURN
1650 FOR J=1 TO 20: SOUND 500+30*J,.5:NEXT J
1655 IF STRIG(5)<>-1 THEN 1850
1660 COLOR 10
1670 FOR J=1 TO 50:NEXT J
1680 COLOR 1 :RETURN
1690 STRIG(0) STOP
1700 LINE(319,0)-(GUNX+4,GUNY),2
1710 LINE(319,199)-(GUNX+4,GUNY+4),2
1720 LINE(0,199)-(GUNX,GUNY+4),2
1730 LINE(0,0)-(GUNX,GUNY),2
1735 FOR I=2000 TO 500 STEP -500 : SOUND I,1: NEXT I
1740 LINE(0,0)-(GUNX,GUNY),0
1750 LINE(319,0)-(GUNX+4,GUNY),0
1760 LINE(319,199)-(GUNX+4,GUNY+4),0
1770 LINE(0,199)-(GUNX,GUNY+4),0
1790 IF POINT(GUNX-1,GUNY)=3 THEN 1799
1792 IF POINT(GUNX+5,GUNY)=3 THEN 1799
1793 IF POINT(GUNX,GUNY-1)=3 THEN 1799
1794 IF POINT(GUNX,GUNY+5)=3 THEN 1799
1795 STRIG(0) ON
1796 RETURN
1799 PLAY SONG$
1800 FOR I=1 TO 35
1810 CIRCLE(GUNX+2,GUNY+2),I,2
1820 CIRCLE(GUNX+2,GUNY+2),I,0
1830 NEXT I
1832 SCORE=SCORE+1
1834 LOCATE 25,5: PRINT SCORE;"ship(s) shot down!";:FOR I=1 TO 2000 : NEXT I
1836 ROUND=ROUND-2
1840 IF ROUND>=4 THEN GOTO 1230
1842 CLS: PRINT:PRINT:PRINT "      CONGRADULATIONS !!!"
1844 PLAY SONG$: PRINT"You have destroyed all the tie-fighters."
1846 PRINT "You are now a jeti !!!"
1847 GOTO  1870
1850 COLOR 12: FOR I=1 TO 500 :NEXT I
1855 SOUND 200,20
1860 COLOR 1: CLS: PRINT:PRINT:PRINT "You have been hit by the tie-fighter!"
1870 PRINT "The Empire is still strong! "
1880 PRINT "Do you want to fight it again? (Y or N)"
1890 A$=INKEY$: IF A$="" THEN 1890
1900 IF A$="N" OR A$="n" THEN 1910
1905 IF A$="Y" OR A$="y" THEN 1225
1907 GOTO 1890
1910 PRINT "Bye! The Empire will strike back.": PRINT"Be careful !"
1920 CHAIN"menu"
